Permalink
...
Comparing changes
Open a pull request
- 4 commits
- 7 files changed
- 0 commit comments
- 2 contributors
Unified
Split
Showing
with
38 additions
and 8 deletions.
- +6 −4 .travis.yml
- +4 −1 .travis/deploy.sh
- BIN .travis/key.enc
- +1 −0 Readme.md
- +1 −1 lib/fat.coffee
- +14 −1 scripts/servisi.coffee
- +12 −1 test/servisi.coffee
View
10
.travis.yml
| @@ -1,10 +1,12 @@ | ||
| language: node_js | ||
| node_js: | ||
| - - "6" | ||
| -dist: trusty | ||
| +- '6' | ||
| +dist: trusty | ||
| sudo: false | ||
| deploy: | ||
| provider: script | ||
| - script: .travis/deploy.sh | ||
| + script: | ||
| + - openssl aes-256-cbc -K $encrypted_8b6bbaa2f436_key -iv $encrypted_8b6bbaa2f436_iv -in .travis/key.enc -out .travis/deploy_key.pem -d | ||
| + - bash .travis/deploy.sh | ||
| on: | ||
| - branch: master | ||
| + branch: master |
View
5
.travis/deploy.sh
| @@ -1,7 +1,10 @@ | ||
| #!/bin/bash | ||
| + | ||
| +echo -e "Host $APP_HOSTNAME\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config | ||
| eval "$(ssh-agent -s)" #start the ssh agent | ||
| -echo "$FUNNY_CAT" > .travis/deploy_key.pem | ||
| +openssl aes-256-cbc -K $encrypted_8b6bbaa2f436_key -iv $encrypted_8b6bbaa2f436_iv -in .travis/key.enc -out .travis/deploy_key.pem -d | ||
| chmod 600 .travis/deploy_key.pem # this key should have push access | ||
| ssh-add .travis/deploy_key.pem | ||
| +rm -rf .travis/deploy_key.pem | ||
| git remote add dokku dokku@$APP_HOSTNAME:$APP | ||
| git push --force dokku HEAD:master |
View
BIN
.travis/key.enc
Binary file not shown.
View
1
Readme.md
| @@ -29,6 +29,7 @@ Pomoč: | ||
| .ac <?> -- for what | ||
| .apt <paket> -- Najde pakete po imenu v packages.ubuntu.com | ||
| .asku <pojem> -- Išči po askubuntu, če vsebuje !! potem prikaže povezave | ||
| + .btc <valuta> - Izpiše trenutno BTC vrednost na Bitstamp (na voljo USD, EUR) | ||
| .ddg -- Vse kar zna https://api.duckduckgo.com/api ali https://api.duckduckgo.com/goodies | ||
| .imdb <naslov> -- Dobi osnovne podatke z IMBD | ||
| .morje -- Izpiše temperature slovenskega morja (Koper, Debeli rtič ter Piran) | ||
View
2
lib/fat.coffee
| @@ -88,7 +88,7 @@ class Bot extends events.EventEmitter | ||
| autoConnect: false | ||
| autoRejoin: true | ||
| floodProtection: true | ||
| - floodProtectionDelay: 800 | ||
| + floodProtectionDelay: 1500 | ||
| prepEvents: -> | ||
| @client.on 'error', (err) -> | ||
View
15
scripts/servisi.coffee
| @@ -167,4 +167,17 @@ module.exports = (bot) -> | ||
| if data | ||
| irc.reply "Trenutno se predvaja: #{data.response.BroadcastMonitor.Current.artistName} - #{data.response.BroadcastMonitor.Current.titleName}" | ||
| else | ||
| - irc.reply "OMG val202 is down!" | ||
| + irc.reply "OMG val202 is down!" | ||
| + | ||
| + bot.regexp /^\.btc (.+)/, | ||
| + ".btc <valuta> - izpiše trenutno BTC vrednost na Bitstamp", | ||
| + (match, r) -> | ||
| + currency = match[1].toLowerCase() | ||
| + if currency == "eur" || currency == "usd" | ||
| + bot.fetchJSON "https://www.bitstamp.net/api/v2/ticker/btc#{currency}/", (data) -> | ||
| + if data && ! null | ||
| + r.reply "Vrednost BTC v #{currency.toUpperCase()}: last: #{data.last}, low: #{data.low}, high: #{data.high}, bid: #{data.bid}, ask: #{data.ask}" | ||
| + else | ||
| + r.reply "Bitstamp is down" | ||
| + else | ||
| + r.reply "Napačna valuta" | ||
View
13
test/servisi.coffee
| @@ -87,7 +87,18 @@ describe 'servisi.coffee', -> | ||
| bot.test ".time ljubljana", (msg) -> | ||
| expect(msg).to.be.a('string') | ||
| done() | ||
| + | ||
| it 'test .val', (done)-> | ||
| bot.test ".val", (msg)-> | ||
| expect(msg).to.be.a('string') | ||
| - done() | ||
| + done() | ||
| + | ||
| + it 'test .btc eur', (done)-> | ||
| + bot.test ".btc eur", (msg) -> | ||
| + expect(msg).to.be.a('string') | ||
| + done() | ||
| + | ||
| + it 'test .btc usd', (done)-> | ||
| + bot.test ".btc usd", (msg) -> | ||
| + expect(msg).to.be.a('string') | ||
| + done() | ||